/* License Notice:
**
** This program is free software: you can redistribute it and/or modify
**    it under the terms of the GNU General Public License as published by
**    the Free Software Foundation, either version 3 of the License, or
**    (at your option) any later version.
** This program is distributed in the hope that it will be useful,
**   but WITHOUT ANY WARRANTY; without even the implied warranty of
**   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
**   GNU General Public License for more details.
** You should have received a copy of the GNU General Public License
**   along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/**
 * @file scenery.cpp
 * @author TooOld2Rock'nRoll
 * @see scenery.hpp
 */
/*---- Includes ----*/
#include "scenery.hpp"

#include "toolbox/debug.h"


/*---- Methods Implementation ----*/
/**
 * @brief Scenery Base Constructor.
 *
 * @param domain_id - the domain identification to use when loading resources.
 * @param sh - optional Shader to be used on all render operations.
 * @param sprite_count - how many sprites should be pre-allocated.
 */
Scenery::Scenery (DomainID_t domain_id, Shader *sh, unsigned sprite_count) : GameObject(domain_id, sh, sprite_count)
{
    _debug (TRACE, "::%s ()", __FUNCTION__);

    //change to this derived class kind
    this->obj_kind = GameObject::SCENERY;
}//End Constructor

/**
 * @brief Draws the scenery as a set of layered sprites.
 * @remark This is a basic idea of a draw function for scenary.
 *
 * @param delta_t - the time passed in the game loop.
 */
void Scenery::draw ()
{
    unsigned i = 0;
    unsigned count = this->getSpriteCount ();
    Sprite2D *s_list = this->getSprites ();

    _debug (TRACE, "::%s ()", __FUNCTION__);

    for ( ; i < count; ++i)
        s_list[i].draw (*this->obj_shader);
}//End draw ()
